#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
void InserSort(int* a ,int n)
{

	int i = 0;
	for (i = 1; i < n; i++)
	{
		int end = i-1;
		int tmp = a[i];
		while (end >= 0)
		{
			if (a[end] > tmp)
			{
				a[end + 1] = a[end];
				end--;
			}
			else
			{
				break;
			}
		}
		a[end + 1] = tmp;
	}
}
int main()
{
	int a[] = { 1,5,2,10,9,7,2,0,-3,11 };
	int sz = sizeof(a) / sizeof(a[0]);

	InserSort(a, sz);

	int i = 0;
	for (i = 0; i < sz; i++)
	{
		printf("%d ", a[i]);
	}
	return 0;
}